package com.huawei.hwid.core.b.a;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import com.huawei.hwid.core.d.b.e;

class f extends Thread {
    private a a;
    private Handler b;
    private String c;
    private Context d;

    public f(Context context, a aVar, Handler handler, String str) {
        this.a = aVar;
        this.c = str;
        this.d = context;
        this.b = handler;
    }

    public void run() {
        try {
            if (this.b != null) {
                Bundle a = e.a(this.d, this.a, this.c);
                Message obtainMessage = this.b.obtainMessage(0);
                if ((this.d instanceof Activity) && ((Activity) this.d).isFinishing()) {
                    e.d("RequestThread", "context is finished !!", true);
                    return;
                }
                obtainMessage.obj = a;
                this.b.sendMessage(obtainMessage);
            }
        } catch (RuntimeException e) {
            e.d("RequestThread", "RuntimeException", true);
        } catch (Exception e2) {
            e.d("RequestThread", "Exception", true);
        }
    }
}
